package com.b2bpsssm.controller.material.commodity;


import com.b2bpsssm.common.R;
import com.b2bpsssm.pojo.CommodityUnits;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "商品单位页面",tags = "商品单位接口Api")
public class CommodityUnitsController {
    /*
     * 商品单位查询
     * */
    @RequestMapping(value = "/commodity/queryCommodityUnitsByPageLimit",method = RequestMethod.GET)
    @ApiOperation(value = "查询商品单位",notes = "显示商品单位",httpMethod = "get",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "当前页码",required = true),
            @ApiImplicitParam(name = "limit",value = "每页条数",required = true)
    })
    @ResponseBody
    public R queryCommodityUnitsByPageLimit(Integer page, Integer limit){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }



    /*
     * 新增单位
     * */
    @RequestMapping(value = "/commodity/addCommodityUnits",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品单位",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Uni_Create_Date",value = "创建时间",required = true),
            @ApiImplicitParam(name = "com_Uni_Name",value = "单位名称",required = true),
            @ApiImplicitParam(name = "com_Uni_Decimal",value = "允许小数",required = true),
    })
    @ResponseBody
    public R addCommodityUnits(CommodityUnits CommodityUnits){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 删除商品单位
     * */
    @RequestMapping(value = "/commodity/delCommodityUnits",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品单位",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Uni_Name",value = "单位名称",required = true),
    })
    @ResponseBody
    public R delCommodityUnits(String comClaName){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 修改单位
     * */
    @RequestMapping(value = "/commodity/updateCommodityUnits",method = RequestMethod.POST)
    @ApiOperation(value = "修改商品单位",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Uni_Create_Date",value = "创建时间",required = true),
            @ApiImplicitParam(name = "com_Uni_Name",value = "单位名称",required = true),
            @ApiImplicitParam(name = "com_Uni_Decimal",value = "允许小数",required = true),
    })
    @ResponseBody
    public R updateCommodityUnits(CommodityUnits CommodityUnits){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }
}
